war w = 0;
Ext.Function = {

    sumRendererSummary: function(field){
          me = this;
          var store = Ext.getStore('StoreBudgetGrid');
          var records = store.data.items;
          var field = ['Total'];
          function Suma(record, field) {
              var total = 0;
              var j = 0,
              lenn = record.length;
              for (; j < lenn; ++j) {
                 total = total + parseFloat(record[j].get(field));
              }
              return total.toFixed(2);
          };
          if (store.isGrouped()) {
              var groups = store.getGroups();
              var i = 0;
              var len = groups.length;
              if(w > len -1){w = 0;}
              if(w > len){
              w = 0;
              }
              var out = {},
              group;
              for (; i < len; i++) {
                  group = groups[i];
                  out[group.name] = Suma.apply(store, [group.children].concat(field));
              }
              var groupSum = out[groups[w].name];
              w++;
              console.log(groupSum);
              return groupSum;
          } else {
              return Suma.apply(store, [records].concat(field));
          }
      }
};
Ext.sumRendererSummary = Ext.Function.alias(Ext.Function, 'sumRendererSummary');
